package com.antcom.antread.antreaddatacrawl.himalayaData.entity;

import com.antcom.antread.common.core.baseRest.domain.BaseDomain;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;

/**
 * b_c_middle(中间表)
 *
 * @Author 中国蚂蚁技术有限公司
 * @create 2020/12/3 21:13
 */
@Entity
@Table(name = "b_c_middle")
public class BCmiddle extends BaseDomain {

    @Id
    private String id;

    @Column(name = "book_id")
    private String bookId;

    @Column(name = "CHAPER_ID")
    private String chaperId;

    @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.DETACH, optional = false)
    @JoinColumn(name = "CHAPER_ID",insertable=false ,updatable=false)
    @NotFound(action = NotFoundAction.IGNORE)
    private ChapterInfo chapterInfo;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    public String getChaperId() {
        return chaperId;
    }

    public void setChaperId(String chaperId) {
        this.chaperId = chaperId;
    }

    public ChapterInfo getChapterInfo() {
        return chapterInfo;
    }

    public void setChapterInfo(ChapterInfo chapterInfo) {
        this.chapterInfo = chapterInfo;
    }
}
